package com.bw.mallshop.dao;

import androidx.annotation.NonNull;

import com.bw.mallshop.entity.UserEntity;
import com.bw.mallshop.entity.UserEntityValues;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

public class UserIterable implements Iterable<UserEntity>{

    private List<UserEntityValues> list;
    public UserIterable(List<UserEntityValues> list){
        this.list = list;
    }

    @NonNull
    @Override
    public Iterator<UserEntity> iterator() {
        List<UserEntity>userList = new ArrayList<>();
        UserEntity entity = new UserEntity();
        entity.data = list.get(list.size()-1);
        userList.add(entity);
        return userList.iterator();
    }
}
